home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Borland / Borland C++ V5.02 / OWLINC.PAK / DEFS.H < prev    next >
C/C++ Source or Header  |  1997-05-06  |  7KB  |  221 lines

  1. //----------------------------------------------------------------------------
  2. // ObjectWindows
  3. // Copyright (c) 1992, 1997 by Borland International, All Rights Reserved
  4. //
  5. //$Revision:   10.10  $
  6. //
  7. // General definitions used by all ObjectWindows programs. Included directly
  8. // by ObjectWindows source modules.
  9. //----------------------------------------------------------------------------
  10. #if !defined(OWL_DEFS_H)
  11. #define OWL_DEFS_H
  12. #define __OWL_OWLDEFS_H   // Old-style define for VbxGen compatibility
  13.  
  14. //----------------------------------------------------------------------------
  15. // We must use all libraries in DLLs if we are using Owl in a DLL
  16. //
  17. // Define _OWLDLL with -WSE (-WE for 32bit) to use Owl, bids & RTL in dlls.
  18. //
  19. // Be sure _BUILDOWLDLL is defined when building an actual owl dll
  20. //
  21. #if defined(_OWLDLL) || defined(_BUILDOWLDLL)
  22. # if !defined(_OWLDLL)
  23. #   define _OWLDLL
  24. # endif
  25. # if !defined(_WSYSDLL)
  26. #   define _WSYSDLL
  27. # endif
  28. # if !defined(_BIDSDLL)
  29. #   define _BIDSDLL
  30. # endif
  31. # if !defined(_SVCSDLL)
  32. #   define _SVCSDLL
  33. # endif
  34. # if !defined(_RTLDLL)
  35. #   define _RTLDLL
  36. # endif
  37. #endif
  38.  
  39. //----------------------------------------------------------------------------
  40. // Get core Classlib and Winsys header for supporting defines
  41. //
  42. #if !defined(CLASSLIB_DEFS_H)
  43. # include <classlib/defs.h>      // Supporting defines for app classes
  44. #endif
  45. #if !defined(WINSYS_DEFS_H)
  46. # include <winsys/defs.h>        // Supporting defines for win sys classes
  47. #endif
  48. #if !defined(WINSYS_SYSTEM_H)
  49. # include <winsys/system.h>
  50. #endif
  51.  
  52. //----------------------------------------------------------------------------
  53. // Setup class, function and data modifier macros for OWL.
  54. //
  55. #if defined(_BUILDOWLDLL)
  56. # define _OWLCLASS     __export _CALLCNVN
  57. # define _OWLCLASS_RTL __export
  58. # define _OWLDATA      __export
  59. # define _OWLFUNC      __export
  60. #elif defined(_OWLDLL)
  61. # define _OWLCLASS     __import _CALLCNVN
  62. # define _OWLCLASS_RTL __import
  63. # if defined(BI_PTR_0_32)
  64. #   define _OWLDATA    __import
  65. #   define _OWLFUNC    __import
  66. # else
  67. #   define _OWLDATA    __far
  68. #   define _OWLFUNC
  69. # endif
  70. #else
  71. # if defined(_OWLFARVTABLE)
  72. #   define _OWLCLASS   __huge _CALLCNVN
  73. # else
  74. #   define _OWLCLASS   _CALLCNVN
  75. # endif
  76. # define _OWLCLASS_RTL _EXPCLASS
  77. # define _OWLDATA
  78. # define _OWLFUNC
  79. #endif
  80. #define _OWLFAR
  81.  
  82. //
  83. // Setup modifier for callback function
  84. //
  85. #if defined(BI_PLAT_WIN32)
  86. # define OWL_EXPORT    __declspec(dllexport)
  87. # define OWL_EXPORT16
  88. #elif defined(BI_PLAT_WIN16)
  89. # define OWL_EXPORT
  90. # define OWL_EXPORT16  __export
  91. #endif
  92.  
  93. //----------------------------------------------------------------------------
  94. // Setup class modifier for user classes derived from Owl classes.
  95. //  Force data segment load on method entry in case called back from Owl for
  96. //  16bit windows DLLs using Owl in a DLL
  97. //
  98. #if defined(_OWLDLL) && defined(BI_APP_DLL) && defined(BI_PLAT_WIN16)
  99. # define _USERCLASS __export _CALLCNVN
  100. #else
  101. # define _USERCLASS _CALLCNVN
  102. #endif
  103.  
  104. //----------------------------------------------------------------------------
  105. // Define macro for user code to force inclusion of stream registration
  106. // objects when statically linking to OWL. Assumes that classlib/objstrm.h has
  107. // been #included at the point where it is used.
  108. //
  109. #if defined(_OWLDLL)
  110. # define _OWLLINK(s)
  111. #else
  112. # define _OWLLINK(s) __link(s)
  113. #endif
  114.  
  115. //----------------------------------------------------------------------------
  116. // Get Classlib, Winsys & Services headers common to all of Owl
  117. //
  118. #if !defined(WINSYS_WSYSINC_H)
  119. # include <winsys/wsysinc.h>     // Windowing system headers
  120. #endif
  121. #if !defined(WINSYS_WSYSCLS_H)
  122. # include <winsys/wsyscls.h>     // Windowing system wrapper classes
  123. #endif
  124. #if !defined(CLASSLIB_STDTEMPL_H)
  125. # include <classlib/stdtempl.h>
  126. #endif
  127. #if !defined(SERVICES_MEMORY_H)
  128. # include <services/memory.h>    // Common memory manipulation functions
  129. #endif
  130. #if !defined(SERVICES_CSTRING_H)
  131. # include <services/cstring.h>   // Standard C++ string class
  132. #endif
  133. #if !defined(SERVICES_CHECKS_H)
  134. # include <services/checks.h>    // Runtime diagnostic macros
  135. #endif
  136.  
  137. //----------------------------------------------------------------------------
  138. // Additional windows.h related defines & undefs for Owl compatibility
  139. //
  140. #if defined(BI_PLAT_WIN32)
  141. # undef GetNextWindow
  142. # undef GetWindowTask
  143. # undef MessageBox
  144.   inline WINAPI MessageBox(HWND hWnd, LPCSTR lpText, LPCSTR lpCaption, uint uType)
  145. # if defined(UNICODE)
  146.     {return MessageBoxExW(hWnd, lpText, lpCaption, uType, 0);}
  147. # else
  148.     {return MessageBoxExA(hWnd, lpText, lpCaption, uType, 0);}
  149. # endif
  150. # define WM_SYSTEMERROR      0x0017
  151. # define WM_CTLCOLOR         0x0019
  152. # define HTASK HANDLE    // allow users to use the same type in Win16 & Win32
  153. #elif defined(BI_PLAT_WIN16)
  154. # define WM_HOTKEY           0x0312
  155. # define WM_PAINTICON        0x0026
  156. #endif
  157. #undef  SetWindowFont
  158. #undef  GetWindowFont
  159.  
  160. //----------------------------------------------------------------------------
  161. // Owl settings for runtime diagnostics in winsys.defs.h & classlib/checks.h
  162. //
  163. #define   OWL_INI     "OWL.INI"
  164. #define   OWL_CDLEVEL  2
  165. #if !defined(OWL_DIAGINFO)
  166. # define OWL_DIAGINFO
  167. #endif
  168.  
  169. //----------------------------------------------------------------------------
  170. // Strict data makes all data members private. Accessors must then be used
  171. // to access the data members.
  172. //
  173. #if defined(OWL_STRICT_DATA)
  174. # define public_data    private
  175. # define protected_data private
  176. #else
  177. # define public_data    public
  178. # define protected_data protected
  179. #endif
  180.  
  181. //----------------------------------------------------------------------------
  182. // Default the OWLx_COMPAT macros to be true unless overriden by NO_OWLx_COMPAT
  183. // macros. These macros turn on OWL 1.0 and 2.X compatibility features.
  184. //
  185. #if !defined(NO_OWL1_COMPAT)
  186. # define OWL1_COMPAT
  187. #endif
  188. #if !defined(NO_OWL2_COMPAT)
  189. # define OWL2_COMPAT
  190. #endif
  191. #if !defined(NO_WIN32S_SUPPORT)
  192. # define WIN32S_SUPPORT
  193. #endif
  194.  
  195. //----------------------------------------------------------------------------
  196. // Common external Owl functions & data
  197. //
  198. #include <owl/version.h>             // OWL version # constants
  199.  
  200. #if defined(BI_NAMESPACE)
  201. namespace OWL {
  202. #endif
  203.  
  204. uint16 far _OWLFUNC OWLGetVersion(); // Get version of OWL (dll) at runtime
  205.  
  206. #if defined(BI_NAMESPACE)
  207. } // namespace OWL
  208. #endif
  209.  
  210. #if defined(BI_NAMESPACE)
  211. using namespace OWL;
  212. #endif
  213.  
  214. #if defined(BI_NAMESPACE)
  215. # define NS_OWL OWL
  216. #else
  217. # define NS_OWL
  218. #endif
  219.  
  220. #endif  // OWL_DEFS_H
  221.